package org.jeecg.modules.online.config.p022d;

import freemarker.core.TemplateClassResolver;
import freemarker.template.Configuration;
import java.io.StringWriter;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/* renamed from: org.jeecg.modules.online.config.d.g */
/* loaded from: hibernate-re-3.7.1-RC.jar:org/jeecg/modules/online/config/d/g.class */
public class FreemarkerHelper {

    /* renamed from: a */
    private static final Logger f590a = LoggerFactory.getLogger(FreemarkerHelper.class);

    /* renamed from: b */
    private static Configuration f591b = new Configuration(Configuration.VERSION_2_3_28);

    static {
        f591b.setNumberFormat("0.#####################");
        f591b.setClassForTemplateLoading(FreemarkerHelper.class, "/");
        f591b.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
    }

    /* renamed from: a */
    private static String m23a(String str, String str2, Map<String, Object> map) {
        try {
            StringWriter stringWriter = new StringWriter();
            f591b.getTemplate(str, str2).process(map, stringWriter);
            return stringWriter.toString();
        } catch (Exception e) {
            f590a.error(e.getMessage(), e);
            return e.toString();
        }
    }

    /* renamed from: a */
    public static String m22a(String str, Map<String, Object> map) {
        return m23a(str, "utf-8", map);
    }
}
